@extends('admin.base')

@section('content')
    <div class="layui-card layui-form">
        <div class="layui-card-header layuiadmin-card-header-auto">
            @include('admin.ad._form_search')
        </div>
        <div class="layui-card-body">
            <table id="dataTable" lay-filter="dataTable"></table>
            <!--图片-->
            <script type="text/html" id="toolbarDemo">
                <div class="layui-btn-container">
                    <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="getDisable">禁用</button>
                    <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="getfrozen">启用</button>
                    <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteAll">删除</button>
                </div>
            </script>
            <script type="text/html" id="imgurl">
                <img  src="@{{d.thumb}}" class="layui-img-click" style="max-width: 100px; max-height: 30px;">
            </script>
            <!--状态-->
            <script type="text/html" id="statustpl">
                <input type="checkbox" name="status" value="@{{d.id}}" title="已上线"
                      lay-filter="lay-but-checkbox" wy-data="{url:'{{route('admin.ad.status')}}?status=@{{d.status}}'}" @{{d.status== '1'  ? 'checked' : ''}}>
            </script>
            <!--排序-->
            <script type="text/html" id="sorttpl">
                <input type="text" name="sort" value="@{{d.sort}}" class="layui-input wy-input-blur" wy-data="{url:'{{ route('admin.ad.sort') }}?id=@{{d.id}}',def_value:'@{{d.sort}}',zz:'^\\d{1,}$',zz_title:'请输入有效数字'}">
            </script>

            <script type="text/html" id="options">
                <div class="layui-btn-group">
                    <a class="layui-btn layui-btn-sm"  lay-id="@{{d.id}}" lay-href="/admin/ad/edit/form/@{{d.id}}">编辑</a>
                    <a class="layui-btn layui-btn-danger layui-btn-sm layui-data-delete"  wy-data="{url:'{{route('admin.ad.delete')}}',id:'@{{d.id}}'}">删除</a>
                </div>
            </script>
        </div>
    </div>
@endsection

@section('script')
    @include('admin.ad._js')
@endsection